﻿/*----------------------------------------------------------------
  //Copyright (C) 2012 赵国伟
  //文件功能描述：优惠劵管理
  //创建人：赵国伟
  //生成时间：2012/03/17 16:15:00
//----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Shopping.Common;
using Shopping.Model;
using Shopping.BLL;

public partial class Manage_CouponsManage : BaseManagePage
{
    protected string StartDateOfCoupon;
    protected string EndDateOfCoupon;
    protected string SelectOptionOfUseStatus;
    protected string SelectOptionOfAllotStatus;
    protected string SelectOptionOfExpiredStatus;
    protected string SelectOptionOfGenerateMethod;

    protected QueryCouponsAsPage q;
    protected List<CouponInfo> listOfData;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            q = new QueryCouponsAsPage();
            q.KeyWords = Utility.G("KeyWords");
            q.UseStatus = Utility.G("UseStatus");
            q.AllotStatus = Utility.G("AllotStatus");
            q.GenerateMethod = Utility.G("GenerateMethod");
            q.ExpiredStatus = Utility.G("ExpiredStatus");
            q.CurPage = Utility.G<int>("CurPage");
            if (q.CurPage <= 0)
                q.CurPage = 1;

            StartDateOfCoupon = DateTime.Now.ToString("yyyy-MM-dd");
            EndDateOfCoupon = DateTime.Now.AddYears(1).ToString("yyyy-MM-dd");

            SelectOptionOfUseStatus = Utility.GetEnumToSelectOption<CouponUseStatus>(q.UseStatus);
            SelectOptionOfAllotStatus = Utility.GetEnumToSelectOption<AllotStatusEnum>(q.AllotStatus);
            SelectOptionOfExpiredStatus = Utility.GetEnumToSelectOption<ExpiredStatusEnum>(q.ExpiredStatus);
            SelectOptionOfGenerateMethod = Utility.GetEnumToSelectOption<GenerateMethodEnum>(q.GenerateMethod);
            CouponsManage bllCoupon = new CouponsManage();
            listOfData = bllCoupon.QueryListAsPage(q);


        }
    }
}